<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script type="text/javascript" src="/res/js/jquery/3.3.1/jquery-3.3.1.js"></script>
<script type="text/javascript" src="/res/js/webSocket/sockjs.js"></script>
<script type="text/javascript" src="/res/js/webSocket/stomp.js"></script>

<script type="text/javascript">


var url = window.location.protocol + '//' + window.location.host + '/stompHandler';
var sock = new SockJS(url);
var stomp = Stomp.over(sock);

var headers = {'selector':"(province='河北' AND city ='石家庄') OR (province='河北' AND city ='邯郸')"};


stomp.connect({}, function (frame) {
    stomp.subscribe('/queue/test0522',function (msg) {
        console.info('receive:'+ msg.body);
    },headers);
});

var sendHeaders1 = {'province':'河北','city':'石家庄'};
var sendHeaders2 = {'province':'河北','city':'邯郸'};
var sendHeaders3 = {'location':'Hebei'};

setTimeout(function () {
  stomp.send('/queue/test0522', sendHeaders1, 'Hello, world9');
  stomp.send('/queue/test0522', sendHeaders2 , 'Hello, world0');
  stomp.send('/queue/test0522', sendHeaders3, 'Hello, world8');
}, 2000);




</script>
<body>
22
</body>
</html>